SG FileSys
AttributeMask Property

©1998 by Stinga

Enumerator Object     Constants     Error Codes    
Description

Returns or sets attributes mask.

Syntax

object.AttributeMask As Long

The object is expression that evaluates to the Enumerator object.

Remarks

Enumerator matches items that have any attribute specified in the AttributeMask property. AttributeMask can be any combination of the following flags:

sgfAll All flags
sgfReadOnly The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory applications cannot delete it.
sgfHidden The file or directory is hidden. It is not included in an ordinary directory listing
sgfSystem The file or directory is part of the operating system or is used exclusively by the operating system
sgfDirectory The item identifies a directory
sgfArchive The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal
sgfEncrypted The file or directory is encrypted. For a file this means that all data streams are encrypted. For a directory this means that encryption is the default for newly created files and subdirectories
sgfNormal The file or directory has no other attributes set. This attribute is valid only if used alone
sgfTemporary The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing it back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed
sgfSparseFile The file is a sparse file
sgfReparsePoint The file has an associated reparse point
sgfCompressed The file or directory is compressed. For a file this means that all of the data in the file is compressed. For a directory this means that compression is the default for newly created files and subdirectories
sgfOffline The file data is not immediately available. Indicates that the file data has been physically moved to offline storage
Example

Following example lists all hidden files in the C:\windows directory:

 Option Explicit
 Dim en, item
 Set en = CreateObject("SGFileSys.Enumerator")

 en.RootPath = "C:/windows/"
 en.Recurse = True
 en.NameMask = "*.*"
 en.AttributeMask = sgfHidden

 For Each item In en.Items
    WScript.Echo item.Path
 Next